<template>
  <el-dialog
    title="预览"
    :append-to-body="true"
    :visible.sync="visible"
    :before-close="close"
    :close-on-click-modal="false"
    fullscreen>

    <el-button type="success" class="pan-btn success-btn" v-print="'#mbatch'" size="mini">打印</el-button>

    <div id="mbatch">
      <div v-for="(cl, index) in list" :key="index">
        <batch-print :childDataForm="cl" />
        <!-- <div style="width: 100%;height: 19px;"></div> -->
      </div>
    </div>

  </el-dialog>
</template>

<script>
  import { isBlank } from '@/common/js/utils'
  import BatchPrint from './pass/batch-print'
  export default {
    data() {
      return {
        visible: false,
        list: []
      }
    },
    props: ["childDataForm"],
    components: { BatchPrint },
    created() {
      if (!isBlank(this.childDataForm)) {
        this.list = this.childDataForm.list
        this.visible = true
      }
    },
    methods: {
      close() {
        this.visible = false
        this.$emit('close')
      }
    }
  }
</script>

<style>
</style>
